﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Order.Application.Orders.Commands.UpdateOrder
{
    public record UpdateOrderResult(bool Success);
    public record UpdateOrderCommand(OrderDto OrderDto):ICommand<UpdateOrderResult>;

    public class UpdateOrderValidator : AbstractValidator<UpdateOrderCommand>
    {
        public UpdateOrderValidator()
        {
            RuleFor(x => x.OrderDto.Id).NotEmpty().WithMessage("Id is required");
            RuleFor(x => x.OrderDto.OrderName).NotEmpty().WithMessage("Name is required");
            RuleFor(x => x.OrderDto.CustomerId).NotNull().WithMessage("CustomerId is required");
        }
    }
   
}
